package com.tiyende.kash.loop.sdk.dec.userdec

import android.content.Context
import com.google.gson.Gson
import com.tiyende.kash.loop.sdk.dec.userdec.TiyendeUserDecDataUtils.getUserDec58

/**
 * storage
 */
class TiyendeUserDecType4(val context: Context) {

    fun getUserDecType4Data(): String? {
        return try {
            val data = hashMapOf<String, Any>().apply {
                put("imei", "")
                put("containSd", TiyendeUserDecDataUtils.getUserDec52())
                put("ramCanUse", TiyendeUserDecDataUtils.getUserDec46(context))
                put("ramTotal", TiyendeUserDecDataUtils.getUserDec48(context))
                put("cashCanUse", TiyendeUserDecDataUtils.getUserDec49())
                put("cashTotal", TiyendeUserDecDataUtils.getUserDec51())
                put("extraSD", TiyendeUserDecDataUtils.getUserDec53())
                put("internalTotal", TiyendeUserDecDataUtils.getUserDec41(context))
                put("internalAvailable", TiyendeUserDecDataUtils.getUserDec42(context))
                put("ramDidUsed", TiyendeUserDecDataUtils.getUserDec47(context))
                put("cashDidUsed", TiyendeUserDecDataUtils.getUserDec50())
                put("sdCardTotal", TiyendeUserDecDataUtils.getUserDec54())
            }
            Gson().toJson(data).trim().getUserDec58()

        } catch (e: Exception) {
            null
        }
    }
}